package com.cellulam.framework.core.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.StringUtils;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PagerCondition {
    /**
     * 操作符, Operator枚举
     */
    private Integer operator;

    /**
     * 字段
     */
    private String field;

    /**
     * 值
     */
    private Object value;

    /**
     * jdbc type, 枚举JdbcType
     */
    private Integer jdbcType;

    public boolean isEffective() {
        return this.value != null && !StringUtils.isEmpty(this.value.toString());
    }
}
